<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String basePath = pageContext.getServletContext().getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <%@include file="../../common/common-css.jsp" %>
    <script type="text/javascript" src="../js/jquery-1.4.min.js"></script>
    <style type="text/css">
      input{font-size: 12px}
    </style>
    <script type="text/javascript">
    	$(function(){
    		 //获取当前网址，如： http://localhost:8083/myproj/view/my.jsp
    		   var curWwwPath=window.document.location.href;
    		   //获取主机地址之后的目录，如： myproj/view/my.jsp
    		  var pathName=window.document.location.pathname;
    		  var pos=curWwwPath.indexOf(pathName);
    		  //获取主机地址，如： http://localhost:8083
    		  var localhostPaht=curWwwPath.substring(0,pos);
    		  //获取带"/"的项目名，如：/myproj
    		  var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
    		 //得到了 http://localhost:8083/myproj
    		  var realPath=localhostPaht+projectName;
    		 
    		$("#backBt").click(function(){
    			window.location.href=realPath+"/role/getRoleList";
    		});
    	})
    </script>
<!--  返回上一次目录    onclick="javascript:window.location.href='javascript:history.go(-1)'" -->
  </head>
  
  <body>
<br/>
<br/>  
<form action="${pageContext.servletContext.contextPath }/role/updateRole" method="post">
		<table class="ttab" height="100" width="70%" border="0" cellpadding="0" cellspacing="1"
			align="center">
			<tr>
				<td height="30"
					 colspan="2">
					<div align="center">
					<font color="blue" size="6" ><b>更新角色</b></font>
					</div>
				</td>
			</tr>
			<tr>	
					<td height="30"width="20%" >
						<div align="right" class="STYLE1" >
								角色名称：
						</div>
					</td>
					<td >
						<div align="left" class="STYLE1"  style="padding-left:10px;">
						<input type="hidden" id="roleId" name="id" value="${result.id}"/>
						<input style="height: 20px;width: 200px" name="roleName" value="${result.roleName}"/>
						<span style="color: red">${error}</span>
						</div>
					</td>
				</tr>
			<tr>	
					<td height="30"width="20%" >
						<div align="right" class="STYLE1" >
								角色状态：
						</div>
					</td>
					<td >
						<div align="left" class="STYLE1"  style="padding-left:10px;">
							<input  type="radio"  name="status" <c:if test="${result.status eq '1'}">checked="checked"</c:if> value="1"/>启用
							<input type="radio" name="status" <c:if test="${result.status eq '0'}">checked="checked"</c:if> value="0"/>禁用
						</div>
					</td>
				</tr>
				<tr>
					<td colspan="2" style="padding: 10px">
						<div align="center">
			 				<input type="submit" value="　保　存　" class="input_btn_style1"/>　
			 				<input id="backBt" type="button" value="　返　回　" class="input_btn_style1" />
		 				</div>
					</td>
				</tr>
		</table>
</form>
  </body>
</html>
